$(function(){
    //选座
    var price=0;
    $('.seatb-m').on('click','li',function(){
        $(this).attr('class',"ys");
        var newspan=$('<span></span>');
        if($('#addSpan').children().length<5){
            newspan.html($(this).text());
            console.log(newspan.text());
            $('#addSpan').append(newspan);
            price=price+5;
            $('#price').text(`￥${price}`)
        }else{
            alert('最多购买五张');
        }
    })

    // 回退
    $("header").on('click','a',function() {
        history.go(-1);
    });
    
});